package com.heaven.study.simplefactory;

public class App {
    public static void main(String[] args) {
        try {

            Operator opAdd = new OperatorFactory().getOperator("+");
            System.out.println(opAdd.calculate(1, 2));

            Operator opMinus = new OperatorFactory().getOperator("-");
            System.out.println(opMinus.calculate(3, 1));

            Operator opDivide = new OperatorFactory().getOperator("/");
            System.out.println(opDivide.calculate(3, 3));
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

    }
}